//查找任意类型最大值
class Find<T extends Comparable<T>>{
    public T findMax(T[] arr){
        T max = arr[0];
        for(int i=1;i<arr.length;i++){
            if(arr[i].compareTo(max)>0){
                max = arr[i];
            }
        }
        return max;
    }
}


public class Test3 {
    public static void main(String[] args) {
       Find<Integer> find = new Find();
       Integer[] arr = {1,2,3,4,5,6,7,8,9};
       Integer ret = find.findMax(arr);
        System.out.println(ret);
    }
}
